package utils;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class AnalysisStrutsConfigListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent arg0) {
		System.out.println("AnalysisStrutsConfigListener 销毁成功");
	    arg0.getServletContext().log("==================AnalysisStrutsConfigListener Destroyed=============");
	}

	public void contextInitialized(ServletContextEvent arg0) {
		// TODO Auto-generated method stub
		String xmlPath = arg0.getServletContext().getRealPath("/") + "\\WEB-INF\\classes\\struts-config.xml";
		//System.out.println(xmlPath);
		ParseXmlConfig.parseStrutsConfig(xmlPath);
		System.out.println("解析StrutsConfig.xml完成");
	}

}
